﻿#region Copyright and License
/*==============================================================================
 *  Copyright (c) www.51mvc.com Corporation.  All rights reserved.
 * ===============================================================================
 * This code and information is provided "as is" without warranty of any kind,
 * either expressed or implied, including but not limited to the implied warranties
 * of merchantability and fitness for a particular purpose.
 * ===============================================================================
 * Licensed under the GNU General Public License (GPL) v2
 * http://www.51mvc.com/
 * Create By 小鱼(Leven)  - http://leven.com.cn
 * ==============================================================================*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Infancy.Core.Repository {
    /// <summary>
    /// 抽象数据操作对象,用于封装具体数据操作对象,由容器初始化
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public abstract class RepositoryContext<T> : IDisposable {
        /// <summary>
        /// 具体操作对象,比如ObjectContext,IConnection
        /// </summary>
        public virtual T Instance { get; protected set; }

        /// <summary>
        /// 指示该对象是否操作数据库
        /// </summary>
        public virtual bool IsDatabase { get; protected set; }

        /// <summary>
        /// 回收该对象
        /// </summary>
        public abstract void Dispose();
    }
}
